package fgl.controller;

import fgl.dao.TestDao;
import io.swagger.annotations.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author fuguangli
 * @description 前沿类
 * @Create date:    2017/7/3
 */
@Controller
@Api
public class RestController {
    private Logger logger = LoggerFactory.getLogger(RestController.class);

    @Autowired
    private TestDao testDao;

    @ApiOperation("swagger hello")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query",name="username",dataType = "String" ,required = false,value = "user's name",defaultValue = "jake")
    })
    @ApiResponses({
            @ApiResponse(code = 400,message = "params are unnormal")
    })
    @RequestMapping("hello")
    @ResponseBody
    public String hello() {
        System.out.println("@@@@@@@@@@@@@@-----------"+testDao.listAll());;
        return "welcome to QYSXY Spring Boot ";
    }
}
